#pragma ident "$ID: XY. CAO 2016-11-24 $"

#ifndef GPSTK_MGEXDCBCORRECTION_HPP
#define GPSTK_MGEXDCBCORRECTION_HPP

//============================================================================
//
//  Copyright (c) 
//
//  XY. CAO, Wuhan Uniersity, 2016 
//
//============================================================================

#include "ProcessingClass.hpp"
#include "RecTypeDataReader.hpp"
#include "MGEXDCBReader.hpp"
#include "string"

namespace gpstk
{


   NEW_EXCEPTION_CLASS(RecTypeNotFound, gpstk::Exception);

   /** Only read DLR/IGG daily MGEX DCB file, not DLR week update file
    *
    *
    */
   class MGEXDCBCorrection : public ProcessingClass
   {
      public :

		 typedef std::map<std::string, std::map<std::string, RinexObsID> > MGEXObsType;

           // Default constructr
		 MGEXDCBCorrection()    
			  : mgexDCBStore(NULL), enabledL3(false)
         {};

           /** Return a satTypeValueMap object, adding the new data generated
            *  when calling this object.
            *
            * @param  time     Epoch corresponding to the data.
            * @param  gData    Data object holding the data.
            */
         virtual satTypeValueMap& Process( const CommonTime& time,
                                           satTypeValueMap& gData)
            noexcept(false);

         /** Returns a gnssRinex object, adding the new data generated
          *  when calling this object.
          *
          * @param gData     Data object holding the data.
          */
         virtual void Process(gnssRinex& gData)
            noexcept(false);


         /** Returns a gnssRinex object, adding the new data generated
          *  when calling this object.
          *
          * @param gData     Data object holding the data.
          */
         virtual void Process(commonHeader& comHeader,gnssRinex& gData)
            noexcept(false);

         /** Return a sourceRinex object, adding the new data generated
          *  when calling this object.
          *
          * @param gData     Data object holding the data.
          */
         virtual void Process(commonHeader& comHeader,sourceRinex& gData) ;


		 // whether use L3
		 virtual void setL3Falg(bool l3flag)
		 { enabledL3 = l3flag;};

         virtual void setDCBStore(MGEXDCBReader& dcbStore)
         {
            mgexDCBStore = &dcbStore;
         };

           // Returns a string identifying this object.
         virtual std::string getClassName () const;


           // Default deconstructr
         ~MGEXDCBCorrection(){};


      private:

		  // Object that reads and stores MGEX DCB data
		  MGEXDCBReader* mgexDCBStore;

		  // Correct the third frequency
		  bool enabledL3;
         
   }; // End of class 'MGEXDCBCorrection'

      // @}

}; // end of namespace gpstk

#endif   // GPSTK_MGEXDCBCORRECTION_HPP
